import { AppUser, UserDTO } from '@/api/application/allocationApp/types';
import { AxiosPromise } from 'axios';
import request from '@/utils/request';

/**
 * 查询应用已授权用户列表
 */
export const allocatedUserList = (query: any): AxiosPromise<UserDTO[]> => {
  return request({
    url: '/application/application/authUser/allocatedList',
    method: 'get',
    params: query
  });
};
/**
 * 查询应用未授权用户列表
 */
export const unallocatedUserList = (query: any): AxiosPromise<UserDTO[]> => {
  return request({
    url: '/application/application/authUser/unallocatedList',
    method: 'get',
    params: query
  });
};

/**
 * 取消用户授权应用
 */
export const authUserCancel = (data: any) => {
  return request({
    url: '/application/application/authUser/cancel',
    method: 'put',
    params: data
  });
};

/**
 * 批量取消用户授权应用
 */
export const authUserCancelAll = (data: any) => {
  return request({
    url: '/application/application/authUser/cancelAll',
    method: 'put',
    params: data
  });
};

/**
 * 授权用户选择
 */
export const authUserSelectAll = (data: any) => {
  return request({
    url: '/application/application/authUser/selectAll',
    method: 'put',
    params: data
  });
};
